# Please remember to update the documentation if you make changes to these parameters!
parameters:
  HelixSource: 'pr/default'              # required -- sources must start with pr/, official/, prodcon/, or agent/
  HelixType: 'tests/default/'            # required -- Helix telemetry which identifies what type of data this is; should include "test" for clarity and must end in '/'
  HelixBuild: $(Build.BuildNumber)       # required -- the build number Helix will use to identify this -- automatically set to the AzDO build number
  HelixTargetQueues: ''                  # required -- semicolon delimited list of Helix queues to test on; see https://helix.dot.net/ for a list of queues
  HelixAccessToken: ''                   # required -- access token to make Helix API requests; should be provided by the appropriate variable group
  HelixPreCommands: ''                   # optional -- commands to run before Helix work item execution
  HelixPostCommands: ''                  # optional -- commands to run after Helix work item execution
  WorkItemDirectory: ''                  # optional -- a payload directory to zip up and send to Helix; requires WorkItemCommand; incompatible with XUnitProjects
  CorrelationPayloadDirectory: ''        # optional -- a directory to zip up and send to Helix as a correlation payload
  IncludeDotNetCli: false                # optional -- true will download a version of the .NET CLI onto the Helix machine as a correlation payload; requires DotNetCliPackageType and DotNetCliVersion
  DotNetCliPackageType: ''               # optional -- either 'sdk' or 'runtime'; determines whether the sdk or runtime will be sent to Helix; see https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json
  DotNetCliVersion: ''                   # optional -- version of the CLI to send to Helix; based on this: https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json
  EnableXUnitReporter: false             # optional -- true enables XUnit result reporting to Mission Control
  WaitForWorkItemCompletion: true        # optional -- true will make the task wait until work items have been completed and fail the build if work items fail. False is "fire and forget."
  Creator: ''                            # optional -- if the build is external, use this to specify who is sending the job
  DisplayNamePrefix: 'Send job to Helix' # optional -- rename the beginning of the displayName of the steps in AzDO 
  condition: succeeded()                 # optional -- condition for step to execute; defaults to succeeded()
  continueOnError: false                 # optional -- determines whether to continue the build if the step errors; defaults to false
  BuildConfig: 'checked'                 # optional -- Mostly, superpmi will be run on checked builds
  InputArtifacts: ''
  CollectionType: ''
  CollectionName: ''
  ProjectFile: ''

steps:
- template: /eng/pipelines/common/templates/runtimes/send-to-helix-inner-step.yml
  parameters:
    osGroup: ${{ parameters.osGroup }}
    sendParams: $(Build.SourcesDirectory)/src/coreclr/scripts/${{ parameters.ProjectFile }} /restore /t:Test /bl:$(Build.SourcesDirectory)/artifacts/log/$(BuildConfig)/SendToHelix.binlog
    displayName: ${{ parameters.DisplayNamePrefix }}
    condition: ${{ parameters.condition }}
    shouldContinueOnError: ${{ parameters.continueOnError }}
    environment:
      MchFileTag: $(MchFileTag)
      BuildConfig:  ${{ parameters.BuildConfig }}
      InputArtifacts: ${{ parameters.InputArtifacts }}
      CollectionType: ${{ parameters.CollectionType }}
      CollectionName: ${{ parameters.CollectionName }}
      HelixSource: ${{ parameters.HelixSource }}
      HelixType: ${{ parameters.HelixType }}
      HelixBuild: ${{ parameters.HelixBuild }}
      HelixTargetQueues: ${{ parameters.HelixTargetQueues }}
      HelixAccessToken: ${{ parameters.HelixAccessToken }}
      HelixPreCommands: ${{ parameters.HelixPreCommands }}
      HelixPostCommands: ${{ parameters.HelixPostCommands }}
      WorkItemDirectory: ${{ parameters.WorkItemDirectory }}
      CorrelationPayloadDirectory: ${{ parameters.CorrelationPayloadDirectory }}
      IncludeDotNetCli: ${{ parameters.IncludeDotNetCli }}
      DotNetCliPackageType: ${{ parameters.DotNetCliPackageType }}
      DotNetCliVersion: ${{ parameters.DotNetCliVersion }}
      EnableXUnitReporter: ${{ parameters.EnableXUnitReporter }}
      WaitForWorkItemCompletion: ${{ parameters.WaitForWorkItemCompletion }}
      Creator: ${{ parameters.Creator }}
      SYSTEM_ACCESSTOKEN: $(System.AccessToken)